var express = require('express');
var router = require('./Route'); //routes是文件夹  会自动寻找index
var session = require('express-session');
let constdefine = require('./constDefine');
let cors = require('cors');
let bodyParser = require('body-parser');

var app = express();

app.use(session({
    secret: 'sessiontest',
    resave: true,
    saveUninitialized: true
}));

app.use(bodyParser.urlencoded({ extended: false }))

app.use(bodyParser.json())

app.use(cors);

app.get("/",function(req,res){
    res.send("1");
});


// router(app);

app.listen(constdefine.server_port, function () {
    console.log("http://localhost:"+ constdefine.server_port);
});